package j2EE.servlet;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Created with Intel IDEA.
 *
 * @Auther: gjt
 * @Date: 2024/9/1 9:39
 */
public class MailingServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        // 获取前端传入的邮箱（url 上）
        String email = req.getParameter("email");

        req.setAttribute("email",email);
        // 使用 requestDispatcher 转移控制权
        RequestDispatcher requestDispatcher = req.getRequestDispatcher("/success.jsp");
        requestDispatcher.forward(req,resp);
    }


}
